home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDSADLG.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.0 KB  |  103 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : sdsadlg.rul                                               */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdShowAnyDialog       */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  /*------------------------------------------------------------------------*/
  18.  /*                                                                        */
  19.  /*   Function: SdShowAnyDialog                                            */
  20.  /*                                                                        */
  21.  /*   Descrip:  This dialog will show any predefined dialog                */
  22.  /*                                                                        */
  23.  /*   Misc:                                                                */
  24.  /*                                                                        */
  25.  /*------------------------------------------------------------------------*/
  26. function SdShowAnyDialog(szTitle, szDialogId, nDialogId, nStyle)
  27.           STRING  szDlg, szTemp;
  28.           NUMBER  nId, nTemp;
  29.           HWND    hwndDlg;
  30.           BOOL    bDone;
  31.         begin
  32.  
  33.            szDlg     = SD_DLG_SHOWANYDIALOG;
  34.            nSdDialog = SD_NDLG_SHOWANYDIALOG;
  35.  
  36.            // record data produced by this dialog
  37.            if (MODE=SILENTMODE) then
  38.              SdMakeName( szAppKey, szDlg, szTitle, nSdShowAnyDialog );
  39.              SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  40.              return nId;
  41.            endif;
  42.  
  43.            // ensure general initialization is complete
  44.            if (!bSdInit) then
  45.               SdInit();
  46.            endif;
  47.  
  48.            if (EzDefineDialog( szDlg, "", szDialogId, nDialogId ) = DLG_ERR) then
  49.                return -1;
  50.            endif;
  51.  
  52.  
  53.            // Loop in dialog until the user selects a standard button
  54.            bDone = FALSE;
  55.  
  56.            while (!bDone)
  57.  
  58.               nId = WaitOnDialog( szDlg );
  59.  
  60.               switch (nId)
  61.               case DLG_INIT:
  62.                    hwndDlg = CmdGetHwndDlg( szDlg );
  63.                    SdGeneralInit( szDlg, hwndDlg, nStyle, szSdProduct );
  64.  
  65.                    if(szTitle != "") then
  66.                        SetWindowText(hwndDlg, szTitle);
  67.                    endif;
  68.  
  69.               case BACK:
  70.                    nId    = BACK;
  71.                    bDone  = TRUE;
  72.  
  73.               case DLG_ERR:
  74.                    SdError( -1, "SdShowAnyDialog" );
  75.                    nId   = -1;
  76.                    bDone = TRUE;
  77.  
  78.               case DLG_CLOSE:
  79.                    SdCloseDlg( hwndDlg, nId, bDone );
  80.  
  81.               default:
  82.                    // check standard handling
  83.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  84.                        bDone = TRUE;
  85.                    endif;
  86.               endswitch;
  87.  
  88.            endwhile;
  89.  
  90.            EndDialog( szDlg );
  91.            ReleaseDialog( szDlg );
  92.  
  93.            SdUnInit( );
  94.  
  95.           // record data produced by this dialog
  96.           SdMakeName( szAppKey, szDlg, szTitle, nSdShowAnyDialog );
  97.           SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  98.  
  99.  
  100.            return nId;
  101.  
  102.         end;
  103.